/**
 * 
 */
package org.extdev.device.ltr;

import java.io.Serializable;

import org.extdev.device.ltr.LTR212LibDevice;

/**
 * @author LAP
 *
 */
public class LTR212Channel implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * 0 -10 mV/+10mV<br>
	 * 1 -20 mV/+20mV<br>
	 * 2 -40 mV/+40mV<br>
	 * 3 -80 mV/+80mV<br>
	 * 4 0 mV/+10mV<br>
	 * 5 0 mV/+20mV<br>
	 * 6 0 mV/+40mV<br>
	 * 7 0 mV/+80mV<br>
	 */
	private int scale = 1;
	
	private int channelNo = 1;
	
	public LTR212Channel(int channelNo) {
		this.setChannelNo(channelNo);
	}

	/**
	 * @return the scale
	 */
	public int getScale() {
		return scale;
	}

	/**
	 * @param scale the scale to set
	 * @see org.extdev.device.ltr.LTR212Channel#scale scale
	 */
	public void setScale(int scale) {
		if ((scale < 0) || (scale > 7)) throw new IndexOutOfBoundsException("Scale must be >= 0 or <= 7");
		this.scale = scale;
	}

	/**
	 * @return the channelNo
	 */
	public int getChannelNo() {
		return channelNo;
	}

	/**
	 * @param channelNo the channelNo to set
	 */
	public void setChannelNo(int channelNo) {
		if ((channelNo < 0) || (channelNo > LTR212LibDevice.maxChannels)) throw new IndexOutOfBoundsException("Channel no must be > 0 or <= 8");
		this.channelNo = channelNo;
	}
}
